package model;

import java.util.ArrayList;
import java.util.List;

/**
 * Publicly accessible struct representing a player.
 * 
 */
public class PlayerModel {
	/** Contains the contents of the player's hand.
	 * Note that order matters for the hand. We may want to impose some sort on the cards in the hand, 
	 * and that sort is reflected in the model. 
	 */
	private ArrayList<Card> cards;
	/** The name of the player. */
	public String name;
	public PlayerModel() {
		this("anonymous");
	}
	public PlayerModel(String name) {
		
		this.name = name;
		this.cards = new ArrayList<Card>();
		
		if (name.equals("John"))
		{
			System.out.println("loading random for north");
			loadSomeRandomCards();
		}
		
	}
	
	public ArrayList<Card> getCards()
	{
		return cards;
	}
	
	public void addCardsToHand(List<Card> cardList)
	{
		for (Card c : cardList)
		{
			cards.add(c);
		}
	}
	
	private void loadSomeRandomCards() {
		cards.add(new Card(12, Suit.SPADE));
		//cards.add(new Card(6, Suit.DIAMOND));
		//cards.add(new Card(3, Suit.CLUB));
		cards.add(new Card(6, Suit.SPADE));
		//cards.add(new Card(9, Suit.HEART));
		cards.add(new Card(9, Suit.SPADE));
		cards.add(new Card(4, Suit.SPADE));
		//cards.add(new Card(2, Suit.HEART));
		//sortCardsInHand();
		
	}
	
}
